<template>
  <div id="banner" style="padding-top: 105px">
    <div class="w">
      <el-carousel trigger="click" height="400px" width="1200px">
        <el-carousel-item v-for="(item, index) in banners" :key="index">
          <img :src="item.imageUrl" alt="" />
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
// 引入banner图网络请求
import { banner } from "../../network/index";
export default {
  name: "Banner",
  data() {
    return {
      banners: [],
    };
  },
  created() {
    banner().then((res) => {
      if (res.data.code == "200") {
        this.banners = res.data.banners;
      }
    });
  },
  methods: {},
  components: {
    banner,
  },
};
</script>

<style>
el-carousel {
  height: 400px;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}

.el-carousel__item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 20px 0;
}
.el-carousel__item:nth-child(2n) {
}

.el-carousel__item:nth-child(2n + 1) {
}
</style>